package com.example.loan;

import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("credit-reports")
public class CreditReportController {
    @GetMapping("/{idCard}")
    public CreditReport report(@PathVariable String idCard) {
        String level;
        switch (idCard) {
            case "410000000000000000":
                level = "A";
                break;
            case "410000000000000001":
                level = "B";
                break;
            case "410000000000000002":
                level = "C";
                break;
            case "410000000000000003":
                level = "D";
                break;
            default:
                level = "";
                break;
        }
        return new CreditReport(level);
    }

}
